home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{DE90AEA0-1461-11CF-858F-0080C7973784}#1.1#0"; "CIHTTP.OCX"
- Begin VB.Form Session
- BorderStyle = 3 'Fixed Dialog
- Caption = "HTTP Session - (Background)"
- ClientHeight = 2700
- ClientLeft = 1245
- ClientTop = 1935
- ClientWidth = 4590
- Icon = "Session.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2700
- ScaleWidth = 4590
- ShowInTaskbar = 0 'False
- Begin VB.ListBox lstAnchors
- BackColor = &H00FFFFFF&
- BeginProperty Font
- Name = "Courier New"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 2085
- Left = 0
- TabIndex = 1
- Top = 600
- Width = 2355
- End
- Begin CIHTTPLib.CIHTTP HTTPControl
- Height = 450
- Left = 1905
- Top = 75
- Width = 480
- _Version = 65537
- _ExtentX = 847
- _ExtentY = 794
- _StockProps = 0
- FileClosedWAV = ""
- HTTPServerConnectionWAV= ""
- HTTPServerConnectionClosedWAV= ""
- ListBoxesPopulatedWAV= ""
- PacketReceivedWAV= ""
- PacketSentWAV = ""
- SocketClosedWAV = ""
- WSAErrorWAV = ""
- URL = ""
- HostName = ""
- HostAddress = ""
- ProxyServerName = ""
- ProxyServerAddress= ""
- LocalFileName = "c:\$$cihttp.tmp"
- End
- Begin VB.Label lblReadMe
- AutoSize = -1 'True
- Caption = "List of anchors. 'Bound' to CIHTTP control."
- ForeColor = &H00800000&
- Height = 390
- Index = 1
- Left = 2490
- TabIndex = 2
- Top = 885
- Width = 1890
- WordWrap = -1 'True
- End
- Begin VB.Label lblReadMe
- Caption = "Crescent HTTP Control"
- ForeColor = &H00800000&
- Height = 195
- Index = 0
- Left = 2490
- TabIndex = 0
- Top = 255
- Width = 1995
- WordWrap = -1 'True
- End
- Attribute VB_Name = "Session"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '<Public>---------------------------------------------
- Public Connected As Boolean
- Public GotPage As Boolean
- Public TimedOut As Boolean
- Public ServerNode As Node
- Public ThisExplorer As Form
- Public ThisCallback As HTTPCallback
- Public ThisServer As HTTPServer
- Public WWWSiteName As String
- Public WorkingDir As String
- '</Public>--------------------------------------------
- '<Private>--------------------------------------------
- Private Alias As String
- Private GetListing As Boolean
- '</Private>-------------------------------------------
- Private Sub Form_Load()
- '---- "Bind" the ListBoxes
- With HTTPControl
- Set .AnchorListBoxName = lstAnchors
- End With
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- 'HTTPControl.QUIT
- End Sub
- Private Sub Form_Terminate()
- '---- explicitly destroy all objects
- Set ServerNode = Nothing
- Set ThisExplorer = Nothing
- Set ThisCallback = Nothing
- Set ThisServer = Nothing
- End Sub
- '----------------------------------------------------
- '<Purpose> forces this form to transfer data from the
- ' HTTPServer class object into the HTTP Control
- '----------------------------------------------------
- Public Sub InitSession()
- Alias = ThisServer.Alias
- With HTTPControl
- If (WorkingDir = "") Then
- .URL = ThisServer.DefaultURL
- Else
- .URL = WorkingDir
- End If
-
- If ThisServer.UseProxy Then
- .ProxyServerName = ThisServer.ProxyName
- .HostName = ""
- '---- append the host name for proxy servers
- .URL = "http://" & ThisServer.HostName & .URL
- Else
- .ProxyServerName = ""
- .HostName = ThisServer.HostName
- End If
-
- End With
- Call Status.ShowStatus("Looking for URL: " & HTTPControl.URL, , , "Search", vbBlue)
- End Sub
- '-----------------------------------------------------
- '<Purpose> creates an HTTP connection
- '-----------------------------------------------------
- Public Sub Connect()
- Connected = False
- GotPage = False
- TimedOut = False
- GetListing = True
- lstAnchors.Clear
- HTTPControl.ConnectToHTTPServer
- Call Status.ShowStatus(Alias & ": connecting for directories and files", , , "Status", vbBlue)
- End Sub
- Private Sub HTTPControl_HTTPServerConnection()
- '---- HTTP request uses the URL property
- HTTPControl.GET
- End Sub
- '--------------------------------------------------------
- '<Purpose> this standard event will fire once all of the
- ' asynchronous listing is completed; at this time call
- ' the callback functions to add the info to the Explorer
- '--------------------------------------------------------
- Private Sub HTTPControl_ListBoxesPopulated()
- GotPage = True
- Call Status.ShowStatus(Alias & ": got directories and files; adding to TreeView", , , "Status", vbBlue)
- WWWSiteName = HTTPControl.WWWSiteName
- If GetListing Then
- '---- turn off redraw on TreeView and ListView
- Call SendMessage(ThisExplorer.Tree.hwnd, WM_SETREDRAW, REDRAWOFF, 0&)
- Call SendMessage(ThisExplorer.List.hwnd, WM_SETREDRAW, REDRAWOFF, 0&)
-
- Call ThisCallback.ShowAnchors(Me, ThisExplorer, ServerNode)
-
- '---- set some properties on the explorer
- ThisExplorer.StatusBar.Panels(1).Text = ThisExplorer.List.ListItems.Count & " object(s)"
- ThisExplorer.Tree.Nodes(ServerNode.Key).Expanded = True
-
- '---- turn redraw back on
- Call SendMessage(ThisExplorer.Tree.hwnd, WM_SETREDRAW, REDRAWON, 0&)
- Call SendMessage(ThisExplorer.List.hwnd, WM_SETREDRAW, REDRAWON, 0&)
-
- ThisExplorer.MousePointer = vbDefault
- End If
- End Sub
- Private Sub HTTPControl_PacketReceived(ByVal Packet As String, ByVal bytes_in As Integer)
- '---- packet received on the access control channel
- Call Status.ShowStatus(Alias & vbCrLf & EOL2CrLf(Packet), , , "Packet", vbRed)
- End Sub
- Private Sub HTTPControl_WSAError(ByVal error_number As Integer)
- If (error_number = WSAETIMEDOUT) Then
- TimedOut = True
- End If
- Call Status.ShowStatus(Alias & ": a WSA error occurred - " & error_number, vbRed, True, "Error", vbBlack)
- ThisExplorer.MousePointer = vbDefault
- End Sub
-